package com.neusoft.neu24.nep.cfg;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

@Configuration
public class PubSubDemo {

    @Bean
    public Supplier<String> source() {
        return () -> {
            System.out.println("================PubSubDemo.source===========================");
            return "Hello World  ----- > " + System.currentTimeMillis();
        };
    }

    @Bean
    public Function<String, String> transfer() {
        return s -> {
            System.out.println("e===========================PubSubDemo.transfere===========================");
            return " Transfer   ----- > " + System.currentTimeMillis() + "  ";
        };
    }

    @Bean
    public Consumer<String> sink() {
        return s -> System.out.println("e===========================   sink   ------ > " + s + "e===========================");

    }
}
